From: zccrs Date: Wed, 7 Mar 2018 02:17:13 +0000 (+0800) Subject: feat: set the default value of includes.path on dtk_build.prf X-Git-Tag: archive/raspbian/5.7.12-2+rpi1^2~122^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=acc9a4abad9c87e9661776a457827b2da8020585;p=dtkcore.git feat: set the default value of includes.path on dtk_build.prf Change-Id: I32d21e302375da6dceb223fb2e63a4dff8c379e3 --- diff --git a/src/dtk_build.prf b/src/dtk_build.prf index 273fd3b..395303a 100644 --- a/src/dtk_build.prf +++ b/src/dtk_build.prf @@ -1,3 +1,7 @@ +isEmpty(TARGET): error(set TARGET first) +!contains(TARGET, ^dtk[a-z0-9]+$): error(The format of the value of TARGET is incorrect. eg: dtk[a-z0-9]+) +!isEqual(TARGET, dtkcore):!contains(QT, dtkcore): error(QT += dtkcore first) + defineTest(checkDtkVersion) { isEmpty(VERSION) { !isEqual(TARGET, dtkcore) { @@ -49,20 +53,27 @@ isEmpty(PREFIX){ } isEmpty(LIB_INSTALL_DIR) { - LIB_INSTALL_DIR=$$PREFIX/lib - target.path = $$PREFIX/lib -} else { - target.path = $$LIB_INSTALL_DIR + isEqual(TARGET, dtkcore) { + LIB_INSTALL_DIR=$$PREFIX/lib + } else { + LIB_INSTALL_DIR=$${QT.dtkcore.libs} + } } +isEmpty(target.path): target.path = $$LIB_INSTALL_DIR + isEmpty(INCLUDE_INSTALL_DIR) { - INCLUDE_INSTALL_DIR = $$PREFIX/include/libdtk-$${VER_MAJ}.$${VER_MIN}.$${VER_PAT} - DTK_INCLUDEPATH = $$PREFIX/include/libdtk-$${VER_MAJ}.$${VER_MIN}.$${VER_PAT} -} else { - DTK_INCLUDEPATH = $$INCLUDE_INSTALL_DIR/libdtk-$${VER_MAJ}.$${VER_MIN}.$${VER_PAT} + isEqual(TARGET, dtkcore) { + INCLUDE_INSTALL_DIR = $$PREFIX/include/libdtk-$${VER_MAJ}.$${VER_MIN}.$${VER_PAT} + } else { + INCLUDE_INSTALL_DIR = $${QT.dtkcore.includes}/.. + } } -!isEmpty(DTK_STATIC_LIB){ +DTK_INCLUDEPATH = $$INCLUDE_INSTALL_DIR +isEmpty(includes.path): includes.path = $$DTK_INCLUDEPATH/D$$upper($$str_member($$TARGET, 3, 3))$$str_member($$TARGET, 4, -1) + +!isEmpty(DTK_STATIC_LIB) { DEFINES += DTK_STATIC_LIB CONFIG += staticlib } diff --git a/src/src.pro b/src/src.pro index 13e8fb9..ef5638a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -77,7 +77,6 @@ defineTest(updateDtkCoreConfigFile) { # ---------------------------------------------- # install config includes.files += $$PWD/*.h $$PWD/dtkcore_config.h $$PWD/DtkCore -includes.path = $${DTK_INCLUDEPATH}/DCore INSTALLS += includes target